package main

import (
	"bufio"
	"os"
	"fmt"
)

func main()  {
	test1()
}


func test1()  {
	path2 := "/home/daniel/tmp/demo02_time.go"

	file,_ := os.Open(path2)

	reader := bufio.NewReader(file)
	//
	//data,_:= reader.ReadString('\n')
	//fmt.Print(data)
	//
	//data,_= reader.ReadString('\n')
	//fmt.Print(data)
	//
	//data,_= reader.ReadString('\n')
	//fmt.Print(data)

	//读取成一个字符串
/*	for {
		data,err:= reader.ReadString('\n')

		if err == io.EOF {
			fmt.Println("读取结束----")
			break
		}

		fmt.Print(data)
	}
	*/

	data,_:= reader.ReadBytes('\n')
	fmt.Println(string(data))
	file.Close()


	//读取键盘
	reader2 := bufio.NewReader(os.Stdin)
	data2 ,_ := reader2.ReadString('\n')

	fmt.Println(data2)

}